import '../css/common.less';
import '../css/exam-report.less';


let num = parseInt($('#data-num').val());
let pPalce = 0.72+(9.07-0.72)*num/100;
let pColor = '#d93c3c';
let addnum = 0;
let addsecond = 500/num;
if(num >= 80) {
    pColor = '#30c27b';
}else if (num >= 60) {
    pColor = '#6dd6a3';
}else if (num >= 40) {
    pColor = '#e7d661';
}else if (num >= 20) {
    pColor = '#e18e5d';
}
//立即下载按钮显示
$(window).on('scroll', function () {
    if($(window).scrollTop()>$('.head').height()) {
        $('#download').css({'bottom':'0'});
    } else {
        $('#download').css({'bottom':'-1.2rem'});
    }
});
//进度条和分数动画
setTimeout(function() {
    let addtime = setInterval(function() {
        $('#num').text(addnum);
        addnum +=1;
        if(addnum > num) {
            clearInterval(addtime);
        }
    },addsecond);

    $('#pointer').animate({
        'left':pPalce+'rem',
    }).css({
        'border-bottom-color':pColor
    })
},500);
